/* ═══════════════════════════════════════════
   train.css — Страница тренировки
   ═══════════════════════════════════════════ */

/* ── Переменные (те же, что в home.css) ─── */
:root {
  --bg-base:         #080604;
  --bg-surface:      #100d08;
  --bg-card:         #1a150d;
  --gold-primary:    #c9a84c;
  --gold-dim:        #8b6914;
  --gold-glow:       rgba(201, 168, 76, 0.18);
  --parchment:       #e8d5a3;
  --parchment-dim:   #b8a07a;
  --correct-color:   #4caf7d;
  --correct-glow:    rgba(76, 175, 125, 0.22);
  --wrong-color:     #c0392b;
  --wrong-glow:      rgba(192, 57, 43, 0.22);

  --font-display:    'Cinzel Decorative', serif;
  --font-body:       'EB Garamond', serif;

  --header-h:        64px;
  --footer-h:        72px;
}

/* ── Reset ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg-base);
  color: var(--parchment);
  font-family: var(--font-body);
  overflow: hidden;
}

/* Grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

/* ─────────────────────────────────────────
   ШАПКА
   ───────────────────────────────────────── */
.train-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: linear-gradient(to bottom, rgba(8,6,4,0.97) 0%, rgba(8,6,4,0.75) 100%);
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
}

/* Логотип */
.train-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold-primary);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-shadow: 0 0 20px rgba(201, 168, 76, 0.35);
  transition: opacity 0.2s;
}
.train-logo:hover { opacity: 0.75; }

/* Блок прогресса */
.progress-block {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(201, 168, 76, 0.06);
  border: 1px solid rgba(201, 168, 76, 0.18);
  border-radius: 4px;
  padding: 0.35rem 1rem;
}
.progress-stat {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 1.05rem;
}
.progress-stat__icon { font-weight: 700; }
.progress-stat__num  { font-family: var(--font-display); font-size: 1rem; }
.progress-stat__label { font-style: italic; font-size: 0.85rem; color: var(--parchment-dim); }

.progress-stat--correct .progress-stat__icon,
.progress-stat--correct .progress-stat__num { color: var(--correct-color); }
.progress-stat--wrong   .progress-stat__icon,
.progress-stat--wrong   .progress-stat__num { color: var(--wrong-color); }
.progress-stat--total   .progress-stat__num { color: var(--gold-primary); }
.progress-divider { color: var(--gold-dim); opacity: 0.5; }

/* Позиция карточки (право) */
.card-position {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--parchment-dim);
  letter-spacing: 0.05em;
}
.card-position__sep { margin: 0 0.2rem; color: var(--gold-dim); }

/* ─────────────────────────────────────────
   ОСНОВНАЯ ОБЛАСТЬ
   ───────────────────────────────────────── */
.train-main {
  position: fixed;
  top: var(--header-h);
  bottom: var(--footer-h);
  left: 0; right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 1rem;
  overflow: hidden;
}

/* ── Phaser-контейнер ── */
#phaser-card {
  position: relative;
  flex-shrink: 0;
  border-radius: 4px;
  /* Тень от всего канваса */
  filter: drop-shadow(0 8px 32px rgba(0,0,0,0.6));
  transition: filter 0.4s;
}

/* Подсветка правильного ответа */
#phaser-card.glow-correct {
  filter:
    drop-shadow(0 0 16px rgba(76, 175, 125, 0.7))
    drop-shadow(0 8px 32px rgba(0,0,0,0.5));
}
/* Подсветка неправильного ответа */
#phaser-card.glow-wrong {
  filter:
    drop-shadow(0 0 16px rgba(192, 57, 43, 0.7))
    drop-shadow(0 8px 32px rgba(0,0,0,0.5));
}

/* Подсказка / лоадер */
.card-hint {
  position: absolute;
  font-style: italic;
  color: var(--parchment-dim);
  font-size: 0.95rem;
  pointer-events: none;
  transition: opacity 0.3s;
}
.card-hint.hidden { opacity: 0; }

/* ─────────────────────────────────────────
   ОБЛАСТЬ ОТВЕТА
   ───────────────────────────────────────── */
.answer-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  max-width: 600px;
}

.answer-row {
  display: flex;
  gap: 0.6rem;
  width: 100%;
}

/* Поле ввода */
.answer-input {
  flex: 1;
  background: rgba(26, 21, 13, 0.85);
  border: 1px solid var(--gold-dim);
  border-radius: 3px;
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 1.1rem;
  padding: 0.6rem 1rem;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.answer-input::placeholder { color: rgba(184, 160, 122, 0.4); }
.answer-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.answer-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Кнопка «Проверить» */
.btn-submit {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold-primary));
  border: none;
  border-radius: 3px;
  color: var(--bg-base);
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  padding: 0.6rem 1.3rem;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.25s, transform 0.15s;
}
.btn-submit:hover:not(:disabled) { opacity: 0.85; transform: translateY(-1px); }
.btn-submit:disabled { opacity: 0.35; cursor: not-allowed; }

/* Кнопка «Перевернуть» */
.btn-flip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: 3px;
  color: var(--gold-dim);
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.95rem;
  padding: 0.4rem 1rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.btn-flip:hover {
  color: var(--gold-primary);
  border-color: var(--gold-primary);
  background: var(--gold-glow);
}
.btn-flip svg {
  width: 16px; height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────
   НИЖНЯЯ НАВИГАЦИЯ
   ───────────────────────────────────────── */
.train-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: linear-gradient(to top, rgba(8,6,4,0.97) 0%, rgba(8,6,4,0.75) 100%);
  border-top: 1px solid rgba(201, 168, 76, 0.12);
  z-index: 100;
}

/* Кнопки навигации */
.btn-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: 3px;
  color: var(--parchment-dim);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.5rem 1.4rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.15s;
  letter-spacing: 0.04em;
}
.btn-nav svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.btn-nav--next { flex-direction: row-reverse; }
.btn-nav:hover:not(:disabled) {
  color: var(--gold-primary);
  border-color: var(--gold-primary);
  background: var(--gold-glow);
  transform: translateX(2px);
}
.btn-nav--prev:hover:not(:disabled) { transform: translateX(-2px); }
.btn-nav:disabled { opacity: 0.28; cursor: not-allowed; }

/* Точки прогресса */
.footer-dots {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 60%;
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.18);
  border: 1px solid rgba(201, 168, 76, 0.25);
  transition: background 0.3s;
  flex-shrink: 0;
}
.dot.dot--current  { background: var(--gold-primary); }
.dot.dot--correct  { background: var(--correct-color); border-color: var(--correct-color); }
.dot.dot--wrong    { background: var(--wrong-color);   border-color: var(--wrong-color); }

/* ─────────────────────────────────────────
   АДАПТИВ
   ───────────────────────────────────────── */
@media (max-width: 576px) {
  .progress-block { gap: 0.4rem; padding: 0.3rem 0.7rem; }
  .progress-stat__num { font-size: 0.88rem; }
  .btn-nav { padding: 0.45rem 0.9rem; font-size: 0.88rem; }
  .answer-input { font-size: 0.95rem; }
  .footer-dots { max-width: 40%; }
}